package top.meeting.room.module.system.services;

import com.jfinal.plugin.activerecord.Record;
import top.meeting.room.common.base.IBaseService;
import top.meeting.room.module.system.form.ForceForm;
import top.meeting.room.module.system.form.ForceMenuForm;
import top.meeting.room.module.system.form.RootMenuForm;
import top.meeting.room.module.system.form.SonMenuForm;
import top.meeting.room.module.system.model.Force;
import top.meeting.room.module.system.query.ForceQuery;

import java.util.List;

/**
 * 我有故事，你有酒么？
 * JKhaled created by yunqisong@foxmail.com 2017/7/22
 * FOR : 权限服务接口
 */
public interface IForceService extends IBaseService<Force, ForceQuery, ForceForm> {
    
    /**
     * 通过 forceName 准确查找
     *
     * @param forceName
     * @return
     */
    Force findByForceName(String forceName);

    /**
     * 获取权限树方法
     *
     * @return
     */
    List<Record> tree();

    /**
     * 保存权限菜单(按钮)
     *
     * @param forceMenuForm
     * @return
     */
    Force saveForceMenu(ForceMenuForm forceMenuForm);

    /**
     * 保存子菜单(子菜单)
     *
     * @param sonMenuForm
     * @return
     */
    Force saveSonMenu(SonMenuForm sonMenuForm);

    /**
     * 保存根菜单(根菜单)
     *
     * @param rootMenuForm
     * @return
     */
    Force saveRootMenu(RootMenuForm rootMenuForm);
}
